package com.keyidea.jfxui;

import com.keyidea.jfxui.portal.util.FileUtil;
import com.keyidea.jfxui.portal.util.filelock.FileLockUtil;
import javafx.application.Application;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@Slf4j
@SpringBootApplication
public class AppStart {
    /**
     * 文件锁的依凭文件
     */
    public static final String LOCK_FILE_NAME = "fileLock";
    /**
     * 数据库文件所在文件夹
     */
    public static final String SQLITE_DIR_NAME = "db";

    public static void main(String[] args) {
        FileUtil.mkdirSqlite(SQLITE_DIR_NAME);
        FileLockUtil.lockByFile(AppUI.class, args, LOCK_FILE_NAME, Application::launch);
    }

}
